﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Battery : MonoBehaviour {

    private void Awake()
    {
        
    }

    private void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.gameObject.tag == "readybubble")
        {
            this.GetComponent<PolygonCollider2D>().isTrigger = true;
            // Debug.Log(">>>>>>>>>>>>>batterytrigger:" + this.GetComponent<PolygonCollider2D>().isTrigger);
        }
    }

    private void OnCollisionEnter2D(Collision2D coll)
    {
    }

    private void OnTriggerExit2D(Collider2D coll)
    {
        if (coll.gameObject.tag == "readybubble")
        {
            coll.gameObject.tag = "bubble";
            this.GetComponent<PolygonCollider2D>().isTrigger = false;
            // Debug.Log(">>>>>>>>>>>>>>>>>>batterytrigger:" + this.GetComponent<PolygonCollider2D>().isTrigger);
        }
    }
}
